package cn.iocoder.yudao.module.digital.dal.mysql.worksaudio;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.digital.dal.dataobject.worksaudio.WorksAudioDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.digital.controller.admin.worksaudio.vo.*;

/**
 * 数字人声音作品 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface WorksAudioMapper extends BaseMapperX<WorksAudioDO> {

    default PageResult<WorksAudioDO> selectPage(WorksAudioPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WorksAudioDO>()
                .likeIfPresent(WorksAudioDO::getName, reqVO.getName())
                .eqIfPresent(WorksAudioDO::getSort, reqVO.getSort())
                .eqIfPresent(WorksAudioDO::getType, reqVO.getType())
                .eqIfPresent(WorksAudioDO::getFileId, reqVO.getFileId())
                .betweenIfPresent(WorksAudioDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(WorksAudioDO::getId));
    }

}